import { lazy } from 'react'
import { createBrowserRouter, RouteObject } from 'react-router-dom'
import { LazyImportComponent } from '@renderer/components/LazyImportComponent'

const Login = lazy(() => import('../pages/login'))
const Register = lazy(() => import('../pages/register'))
const Layout = lazy(() => import('../layouts/Admin'))
const Home = lazy(() => import('../pages/home'))

export const routes = createBrowserRouter([
  {
    path: '/login',
    element: <Login />
  },
  {
    path: '/register',
    element: <Register />
  },
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/',
        element: <Home />
      },
      {
        path: '/home',
        element: <Home />
      }
    ]
  }
])
